.dialog-box {
    background: #2d2d2d;
    border-radius: 5px;
    margin: 5px 0;

    &.user {
        background: none;
    }
}

.username {
    padding: 3px 6px;
    border-bottom: 1px solid #444;
    font-size: 12px;
    color: #888;
}

.content {
    padding: 3px 6px;
    user-select: text;

    ::ng-deep {

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-weight: bold;
            // color: #222;
            margin-top: 0;
        }

        h1 {
            font-size: 32px;
            margin-bottom: 1em;
        }

        h2 {
            font-size: 28px;
            margin-bottom: 1em;
        }

        h3 {
            font-size: 24px;
            margin-bottom: 1em;
        }

        h4 {
            font-size: 20px;
            margin-bottom: 1em;
        }

        h5 {
            font-size: 16px;
            margin-bottom: 1em;
        }

        h6 {
            font-size: 14px;
            margin-bottom: 1em;
        }

        p,
        ul,
        ol,
        pre,
        table,
        blockquote {
            margin-top: 0.5em;
            margin-bottom: 0.5em;
            font-size: 14px;

            img {
                max-width: 100%;
            }
        }

        ul,
        ol {
            padding-left: 1.5em;
        }

        blockquote {
            padding: 0.5em 1em;
            border-left: 0.25em solid #ccc;
            color: #666;
        }

        a {
            color: #0366d6;
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        table {
            border-collapse: collapse;
            width: 100%;
            position: relative;
            margin-top: 20px;

            &:hover {
                .export-btn {
                    visibility: visible;
                }
            }
        }

        table,
        th,
        td {
            border: 1px solid #ccc;
        }

        th,
        td {
            padding: 0.3em;
            text-align: left;
        }

        hr {
            border: none;
            border-top: 1px solid #ccc;
            margin: 2em 0;
        }

        // Shiki 代码高亮样式
        .shiki {
            background-color: #0d1117 !important;
            color: #e6edf3;
            border-radius: 6px;
            padding: 1rem;
            overflow-x: auto;
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 13px;
            line-height: 1.45;

            .line {
                min-height: 1em;
            }
        }

        // 代码显示
        pre {
            display: grid;
            position: relative;
            margin-top: 10px;
            overflow: visible;

            code {
                display: block;
                overflow-x: auto;
                padding: 0.5em;
            }

            .language-aily-state {
                height: 40px;
                overflow: hidden;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
            }

            .language-aily-board {
                height: 70px;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                overflow: hidden;
            }

            .language-aily-library {
                height: 70px;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                overflow: hidden;
            }

            .language-aily-button {
                height: 70px;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                overflow: hidden;
            }
        }

        .export {
            position: absolute;
            right: 108px;
            top: -20px;
            font-size: 12px;
            height: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            background: none;
            border: none;
            opacity: 0.3;
        }

        .export-btn {
            position: absolute;
            right: 0;
            top: -20px;
            font-size: 12px;
            width: 35px;
            height: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            border: none;
            white-space: nowrap;
            opacity: 0.5;
            background: none;

            &:hover {
                opacity: 1;
            }

            &.excel {
                right: 0;
                border: 1px solid #555;
            }

            &.json {
                right: 36px;
                border: 1px solid #555;
            }

            &.sql {
                right: 72px;
                border: 1px solid #555;
            }
        }

        .copy-btn {
            position: absolute;
            right: 0;
            top: -20px;
            font-size: 12px;
            width: 35px;
            height: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            border: none;
            white-space: nowrap;
            opacity: 0.5;
            background: none;
            border: 1px solid #555;

            &:hover {
                opacity: 1;
            }
        }

        a {
            color: #007bff;
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        p {
            margin-top: 5px;
            margin-bottom: 5px;
            font-size: 14px;
        }
    }
}

.voice-btn {
    margin-left: 15px;
    cursor: pointer;

    i.fa-play {
        color: #00772c;
    }

    i.fa-stop {
        color: rgb(133, 0, 0);
    }
}

.ps {
    padding-top: 5px;
    margin: 0 15px 15px 15px;
    border-top: 1px solid #bbb;
    color: #646464;
}

.image-box {
    display: flex;
    padding: 8px 0 0 8px;

    >div {
        width: 104px;
        height: 104px;
        padding: 8px;
        border: 1px solid #d9d9d9;
        border-radius: 2px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #FFF;
        margin: 0 8px 0 0;

        img {
            max-width: 100%;
            max-height: 100%;
            cursor: pointer;
        }
    }
}

.dialog-box {
    ::ng-deep {

        .blockly-container {
            border: 1px solid #ddd;
            border-radius: 4px;
            margin: 1rem 0;
            background-color: #f5f5f5;
        }

        .blockly-preview {
            width: 100%;
            height: 300px;
            overflow: auto;
        }
    }
}